const { ccclass, property } = cc._decorator;

@ccclass
export default class BgControl extends cc.Component {
  @property(cc.Label)
  label: cc.Label = null;

  @property
  text: string = "hello";

  // LIFE-CYCLE CALLBACKS:

  // onLoad () {}

  start() {}

  update(dt) {
    for (let bgNode of this.node.children) {
      bgNode.y -= 150 * dt;
      if (bgNode.y < -850) {
        bgNode.y += 850 * 2;
      }
    }
  }
}
